
import axios from '@/utils/http'

//接口列表

//-----------------------部门管理-----------------------
//部门列表
export const findDeptList='/userManagement/deptManagement/findDeptList'
//添加
export const addDept='/userManagement/deptManagement/addDept'
//修改
export const updateDeptById='/userManagement/deptManagement/updateDeptById'
//删除
export const delDeptById='/userManagement/deptManagement/delDeptById'
//查询
export const findDeptByName='/userManagement/deptManagement/findDeptByName'
//根据部门id回显部门信息
export const showDeptById='/userManagement/deptManagement/showDeptById'
//部门上移
export const addSortById='/userManagement/deptManagement/addSortById'
//部门下移
export const subSortById='/userManagement/deptManagement/subSortById'


//-----------------------职位管理-----------------------
//职位列表
export const findJobList='/userManagement/job/findJobList'
//添加
export const addJob='/userManagement/job/addJob'
//删除
export const delJobById='/userManagement/job/delJobById'
//修改
export const updateJobById='/userManagement/job/updateJobById'
//查
export const showJobById='/userManagement/job/showJobById'
export const showJobByTitle='/userManagement/job/showJobByTitle'
//-----------------------用户管理-----------------------
//用户列表
export const findUserList='/userManagement/user/findUserList'
//添加
export const addUser='/userManagement/user/addUser'
export const uploadImg='/userManagement/user/uploadImg'
//删除
export const delUserById='/userManagement/user/delDeptById'
//修改
export const updateUser='/userManagement/user/updateUser'
//查
export const findUserByConditions='/userManagement/user/findUserByConditions'
export const findUserByDepId='/userManagement/user/findUserByDepId'
export const findUserByName='/userManagement/user/findUserByName'
export const findUserById='/userManagement/user/findUserById'

//下拉部门列表
export const findDeptList1='/userManagement/deptManagement/findDeptList1'
//下拉职位列表
export const findPosList1='/userManagement/job/findJobList?currentPage=1&pageSize=1000'
//下拉角色列表
export const findOccupationList1='/systemManagement/roleCompany/findRoleList?currentPage=1&pageSize=100'





//封装网络请求方法
//-----------------------部门管理-----------------------
const user={
    //获取部门列表
    getDepList(params){
        return axios.get(findDeptList,{params})
    },
    //添加
    addDep(params){
        return axios.post(addDept,params)
    },
    //修改
    updateDep(params){
        return axios.post(updateDeptById,params)
    },
    //删除
    deleteDep(params){
        return axios.post(delDeptById+"?depId="+params)
    },
    //查询
    searchDep(currentPage,pageSize,depName){
        return axios.get(findDeptByName+"?currentPage="+currentPage+"&pageSize="+pageSize+"&depName="+depName)
    },
    //根据部门id回显部门信息
    showDep(params){
        return axios.get(showDeptById+"?depId="+{params})
    },
    //部门上移
    addSort(params){
        return axios.post(addSortById+"?depId="+params)
    },
    //部门下移
    subSort(params){
        return axios.post(subSortById+'?depId='+params)
    },
//-----------------------职位管理-----------------------
    //获取职位列表
    getPosList(params){
        return axios.get(findJobList,{params})
    },
    //增加
    addPos(params){
        return axios.post(addJob,params)
    },
    //删除
    deletePos(params){
        return axios.post(delJobById+"?id="+params)
    },
    //修改
    updatePos(params){
        return axios.post(updateJobById,params)
    },
    //模糊查询
    searchPos(currentPage,pageSize,title){
        return axios.get(showJobByTitle+"?currentPage="+currentPage+"&pageSize="+pageSize+"&title="+title)
    },
    //根据id查询
    searchPosById(params){
        return axios.get(showJobById+"?id="+{params})
    },
//-----------------------用户管理-----------------------
    //获取部门列表
    getUserList(params){
        return axios.get(findUserList,{params})
    },
    //添加
    addUser(params){
        return axios.post(addUser,params)
    },
    //修改
    changeUser(params){
        return axios.post(updateUser,params)
    },
    //删除
    deleteUser(params){
        return axios.post(delUserById+"?id="+params)
    },
    //上传头像
    uploadImg(params){
        return axios.post(uploadImg+"?img="+params)
    },
    //高级查询
    highLevelSearch(params){
        return axios.post(findUserByConditions,params)
    },
    //根据部门id查询用户
    searchUserByDepId(params){
        return axios.post(findUserByDepId+"?depId="+params)
    },
    //根据id查用户
    searchUserById(params){
        return axios.get(findUserById+"?id="+{params})
    },
    //根据姓名模糊查询
    searchUserByName(currentPage,pageSize,realName){
        return axios.get(findUserByName+"?currentPage="+currentPage+"&pageSize="+pageSize+"&realName="+realName)
    },
    //下拉部门列表
    getDeptList1(params){
        return axios.get(findDeptList1,{params})
    },
    //下拉职位列表
    getPosList1(params){
        return axios.get(findPosList1,{params})
    },
    //下拉角色列表
    getOccupationList1(params){
        return axios.get(findOccupationList1,{params})
    },








}

//导出
export default user;
